<template>
  <div class="home-banner">
    <div class="bg-img">
      <div class="title">{{ title }}</div>
      <div class="sub-title" @click="onBannerClick">{{ subTitle }}</div>
    </div>
  </div>
</template>

<script>
  export default {
    name: "HomeBanner",
    props: {
      title: 'mpvue2.0多端小程序课程重磅上线',
      subTitle: '马上学习',
    },
    methods: {
      onBannerClick() {

      },
    }
  }
</script>

<style lang="less" scoped>
  .home-banner {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    width: 335px;
    height: 125px;
    margin: 20px 5px 0 5px;
    background: url("http://www.youbaobao.xyz/book/res/bg.jpg") no-repeat center;
    background-size: cover;
    border-radius: 15px;
    color: #fff;
    text-align: center;
    .bg-img {
      font-size: 18px;
      .title {
        margin-bottom: 10px;
      }

      .sub-title {
        width: 70px;
        margin: 5px auto 0 auto;
        padding: 5px 15px;
        background: #4585ff;
        border: 1px solid #ccc;
        border-radius: 50px;
        font-size: 14px;
      }
    }
  }
</style>
